package com.example.crm.service.impl;

import com.example.crm.dao.IUserDAO;
import com.example.crm.dao.impl.UserDAOlmpl;
import com.example.crm.service.IUserService;

import java.sql.SQLException;

public class UserServicelmpl implements IUserService {
    @Override
    public boolean login(String username, String password) {
        //调用DAO层查询
        //return (int)(Math.random()*2)==0;
        IUserDAO userDAO=new UserDAOlmpl();
        try {
            boolean result=userDAO.findByUsernamePassword(username,password);
            return result;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;
    }
}
